﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using Project.Module.DAO.CMSBL;

namespace Project.Module.Controller
{
    class CMSRecipeController
    {
        
    }

    public partial class HomeController
    {
        public JsonResult AddRecipes(string title, string content, string status)
        {
            (new RecipeBL()).AddRecipes(title, content, status);
            return Json(new { result = 1 }, JsonRequestBehavior.AllowGet);
        }

        public ActionResult DeleteRecipe(int id)
        {
            (new RecipeBL()).DeleteRecipe(id);
            return Redirect("/admin/quan-ly-cong-thuc");
        }

        public JsonResult EditRecipe(int id, string title,int productID , string description, int modifiedBy)
        {
            (new RecipeBL()).EditRecipe(id, title,productID, description, modifiedBy);
            return Json(new { result = 1 }, JsonRequestBehavior.AllowGet);
        }

    }
}
